#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h> 

int main()
{
	int i, r;
	double s, a, b, c, p, a1, a2;
	scanf("%d", &r);
	for (i = 0; i < r; i++) {
		a = b = c = p = s = a2 = a1 = 0;
		scanf("%lf %lf %lf", &a, &b, &c);
		if (a + b > c && a + c > b && b + c > a) {
			p = a + b + c;
			s = p / 2.0;
			a2 = s * (s - a) * (s - b) * (s - c);
			a1 = sqrt(a2);
			printf("area=%.2lf; perimeter=%.2lf\n", a1, p);
		}
		else printf("These sides do not correspond to a valid triangle\n");
	}

	return 0;
}
//1069